<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
	<button id="btn">按钮</button>
	<p>
	<a href="http://www.sogou.com" id="it">sogou</a>
	<script type="text/javascript">
		// var btn = document.getElementById("btn")
		// btn.addEventListener("click",function(e){
		// 	// click
		// 	console.log(e.type)
		// 	// btn.innerHTML='这是点击之后内容'
		// 	e.target.innerHTML='这是点击之后内容'
		// })

		var it = document.getElementById("it")
		it.onclick = function(e){
			e.preventDefault()
			console.log('阻止A标签跳转');
		}

		var btn = document.querySelector("btn")
		btn.onclick = function(e){
			console.log('ByTagName')
		}
		
		
	</script>
</body>
</html>